import axios from './index'
export const login = async (username,pwd) => {
    let res = await axios({
        method:"post",
        url:'/api/users/login',
        data:{
            username,pwd
        }
    });
    return res.data;
}

export const getUser = async () => {
    let res = await axios({
        method:"get",
        url:'/api/getToken',
        headers:{
            Authorization: 'bearer '+ sessionStorage.getItem("token"),
        }
    });
    return res.data;
}